#ifndef GRAPH_H_INCLUDED
#define GRAPH_H_INCLUDED
#include <vector>
#include <list>
#include "GraphNode.h"
#include "GraphEdge.h"
#include "Vec3.h"
#include <deque>

typedef std::list<GraphEdge> EdgeList;
typedef std::vector<EdgeList> Edges;
typedef std::vector<GraphNode> Nodes;


class Graph
{
public:
	Graph();
	bool Test();
	void AddNode(GraphNode& newNode);
	void AddEdge(GraphEdge& newEdge);
	void RemoveNode(int id);
	EdgeList GetEdgeList(int id);
	bool IsEdgePresent(GraphEdge& edge);
	bool IsNodePresent(int id);
	bool IsNodePresent(Vec3f& pos);
	void Draw();
	void DrawWithPath(std::vector<int>& path);
	void LoadGraphFromFile(const std::string& file);
	int ReturnIDofClosest(Vec3f& pos);
	int ReturnIDofClosest(int id);
	int ReturnNextID() {return m_NextNodeID; }
	GraphNode GetNode(int id);

	bool IsEmpty();
	int GetNumEdges();
	int GetNumNodes();

private:

	typedef std::deque<int> Trail;
	int m_NextNodeID;

	Nodes m_Nodes;
	Edges m_Edges;
	std::string m_Filename;

};



#endif


